using JetBrains.Annotations;

namespace UI.UIGame.Loading
{
    [UsedImplicitly]
    public class LoadingProcessEvent
    {
        public LoadingProcessEvent(string title, string subTitle,
            int processCompletedCount, int processTotal,
            int subProcessCompletedCount, int subProcessTotal)
        {
            Title = title;
            SubTitle = subTitle;

            ProcessCompletedCount = processCompletedCount;
            ProcessTotal = processTotal;

            SubProcessCompletedCount = subProcessCompletedCount;
            SubProcessTotal = subProcessTotal;
        }

        public LoadingProcessEvent(string title,
            int processCompletedCount, int processTotal)
        {
            Title = title;

            ProcessCompletedCount = processCompletedCount;
            ProcessTotal = processTotal;

            SubProcessCompletedCount = null;
            SubProcessTotal = null;
        }

        /// <summary>
        /// 主题
        /// </summary>
        public string Title { get; }

        /// <summary>
        /// 子主题
        /// </summary>
        public string SubTitle { get; }

        /// <summary>
        ///     完成进度量
        /// </summary>
        public int ProcessCompletedCount { get; }

        /// <summary>
        ///     进度总量
        /// </summary>
        public int ProcessTotal { get; }

        /// <summary>
        ///     子进度完成量
        /// </summary>
        public int? SubProcessCompletedCount { get; }

        /// <summary>
        ///     子进度总量
        /// </summary>
        public int? SubProcessTotal { get; }
    }
}